//
//  HMTableViewController.swift
//  Weibo
//
//  Created by ZhuDong on 16/5/20.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

class HMTableViewController: UITableViewController {
    var isLogin: Bool = HMUserAccountViewModel.shareAccountViewModel.userLogin()
    var visitorView: HMLoginView = HMLoginView()
    override func loadView() {
        if isLogin {
            super.loadView()
        }else{

            self.view = visitorView
            visitorView.registerBtn.addTarget(self, action: #selector(registerBtnClick), forControlEvents: .TouchUpInside)
            visitorView.loginBtn.addTarget(self, action: #selector(loginBtnClick), forControlEvents: .TouchUpInside)
        }
    }
    func loginBtnClick(){
//        print("点击了登录按钮")
        let oauthVC = HMOAuthViewController()
        let nav = UINavigationController(rootViewController: oauthVC)
        presentViewController(nav, animated: true, completion: nil)
    }
    func registerBtnClick(){
        print("点击了注册按钮")
        
    }
}
